#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/7/26 15:24
# @Author  : Jet
# @Email   : jyan@abot.cn
# @File    : flask_blueprint01.py
import json

from flask import Blueprint, request

"""
调用方式： 

# 导入文件

from xxx  import blueprint01

# 注册蓝图
app.register_blueprint(blueprint01, url_prefix='/blueprint01')

# 访问路径
http://127.0.0.1:8888/blueprint01/index?id=1234

"""

blueprint01 = Blueprint('blueprint01', __name__)

"""蓝图中的函数"""


@blueprint01.route('/index', methods=['GET', 'POST'])
def index():
    # args = request.form
    # args = request.args
    args = request.values

    print('收到参数：' + json.dumps(args, ensure_ascii=False))

    return json.dumps(args, ensure_ascii=False)